home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
windownt
/
perlnt.zip
/
t
/
lib
/
abbrev.nt
next >
Wrap
Text File
|
1993-07-25
|
576b
|
27 lines
require 'abbrev.pl';
print "1..2\n";
%abdul = ();
&abbrev (*abdul, 'he', 'help', 'hi', 'bye', 'wally', 'world');
@good = ('b', 'by', 'bye', 'he', 'hel', 'help', 'hi', 'wa',
'wa', 'wal', 'wall', 'wally', 'wo', 'wor', 'worl',
'world');
@bad = ('barf', 'bad', 'byef', 'hell', 'wallo', 'waldo', 'will');
$ok = 1;
foreach (@good) {
$ok = 0 if !defined($abdul{$_});
}
if ($ok) {print "ok 1\n";} else {print "not ok 1\n";}
$ok = 1;
foreach (@bad) {
$ok = 0 if defined($abdul{$_});
}
if ($ok) {print "ok 2\n";} else {print "not ok 2\n";}